<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends Action {
    public function index(){
        $menu=M('Menu');
        $list=$menu->where('UPERMENUID=0')->order('MENU_ORDER asc')->select();
        
       
        
        $menulist=array();
        for($i=0;$i<count($list);$i++){
        	$uperId=$list[$i]['MENU_ID'];
        	$menu1=M('Menu');
	    	$array['UPERMENUID']=array('eq',$uperId);
	        $menulist=$menu1->where($array)->order('MENU_ORDER asc')->select();
	        $list[$i]['subMenu']=$menulist;
	        //$this->assign('upmenu',$menulist[0]);
	       
        }
         $this->assign('list',$list);

        //dump($contentList);
        $this->display();
    }
    
    public function middleShow(){
    	$this->display();
    }
    //点击父级菜单显示子菜单
   /* function menubyup(){
    	$uperId=(int)$_GET['upermenuid'];
    	$menu=M('Menu');
    	$array['UPERMENUID']=array('eq',$uperId);
        $list=$menu->where($array)->order('MENU_ORDER asc')->select();
        $this->assign('menu',$list);
        dump($list);
        $this->display('index');
    }*/
    
    public function version(){
    	 $this->display();
    }
}